<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSupportTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('support', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('用户id');
            $table->integer('s_user_id')->default(0)->comment('支持者用户id');
            $table->integer('dr_id')->default(0)->comment('作品id');
            $table->timestamps();
            $table->softDeletes();
        });
        Schema::table('design_result', function (Blueprint $table) {
            $table->integer('support_num')->default(0)->comment('支持人数')->after('key');
            $table->decimal('cashback')->default(0)->comment('返现金额')->after('key');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
